<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Query.aspx.vb" Inherits="ccapps.Query"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Query Page</title>
		<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
		<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<style>A:link { COLOR: cadetblue; TEXT-DECORATION: none }
	A:visited { COLOR: olive; TEXT-DECORATION: none }
	A:hover { COLOR: salmon; TEXT-DECORATION: none }
		</style>
		<SCRIPT language="JavaScript">

function check_date(field){
var checkstr = "0123456789";
var DateField = field;
var Datevalue = "";
var DateTemp = "";
var seperator = ".";
var day;
var month;
var year;
var leap = 0;
var err = 0;
var i;
var a = 0;
var ch = "";
   err = 0;
   DateValue = DateField.value;
   if (DateValue.length != 0){
   
   /* Delete all chars except 0..9 */
   for (i = 0; i < DateValue.length; i++) {
        ch = DateValue.charAt(i);
        if (('0'>ch) || (ch>'9')) {
            a++;
         }
   }
        if (a == DateValue.length)  {
   alert("Date is incorrect!");
      DateField.select();
	  DateField.focus();
         }
	  
   for (i = 0; i < DateValue.length; i++) {
	  if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
	     DateTemp = DateTemp + DateValue.substr(i,1);
	  }
   }
   DateValue = DateTemp;
   /* Always change date to 8 digits - string*/
   /* if year is entered as 2-digit / always assume 20xx */
   if (DateValue.length == 6) {
      DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }
   if (DateValue.length != 8) {
      err = 19;}
   /* year is wrong if year = 0000 */
   year = DateValue.substr(4,4);
   if (year == 0) {
      err = 20;
   }
   /* Validation of month*/
   month = DateValue.substr(2,2);
   if ((month < 1) || (month > 12)) {
      err = 21;
   }
   /* Validation of day*/
   day = DateValue.substr(0,2);
   if (day < 1) {
     err = 22;
   }
   /* Validation leap-year / february / day */
   if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
      leap = 1;
   }
   if ((month == 2) && (leap == 1) && (day > 29)) {
      err = 23;
   }
   if ((month == 2) && (leap != 1) && (day > 28)) {
      err = 24;
   }
   /* Validation of other months */
   if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
      err = 25;
   }
   if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
      err = 26;
   }
   /* if 00 ist entered, no error, deleting the entry */
   if ((day == 0) && (month == 0) && (year == 00)) {
      err = 0; day = ""; month = ""; year = ""; seperator = "";
   }
   /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
   if (err == 0) {
      DateField.value = day + seperator + month + seperator + year;
   }
   /* Error-message if err != 0 */
   else {
      alert("Date is incorrect!");
      DateField.select();
	  DateField.focus();
   }
   }
}

		</SCRIPT>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<div align="left">
				<asp:Image id="Image2" runat="server" Width="158px" Height="92px" ImageUrl="IMAGES/AVEA.JPG"></asp:Image>
				<asp:image id="Image1" runat="server" Width="606px" Height="84px" ImageUrl="images/CREATION.JPG"></asp:image></div>
			<asp:hyperlink id="HyperLink2" style="Z-INDEX: 112; LEFT: 640px; POSITION: absolute; TOP: 128px" runat="server" Height="16px" Width="80px" NavigateUrl="giris.aspx" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="Indigo">Home Page</asp:hyperlink><asp:label id="Lblok" style="Z-INDEX: 110; LEFT: 112px; POSITION: absolute; TOP: 240px" runat="server" Height="24px" Width="280px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="#C00000"></asp:label><asp:button id="btn_ara" style="Z-INDEX: 109; LEFT: 272px; POSITION: absolute; TOP: 208px" tabIndex="3" runat="server" Height="24" Width="96px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="SteelBlue" Text="Search"></asp:button><asp:label id="lbl_tar" style="Z-INDEX: 106; LEFT: 40px; POSITION: absolute; TOP: 208px" runat="server" Height="24px" Width="52px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black">Date :</asp:label><asp:label id="lbl_stat" style="Z-INDEX: 105; LEFT: 40px; POSITION: absolute; TOP: 176px" runat="server" Height="24px" Width="60px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black">Status :</asp:label><asp:label id="Label6" style="Z-INDEX: 104; LEFT: 248px; POSITION: absolute; TOP: 128px" runat="server" Height="24px" Width="40px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="Teal">Date :</asp:label><asp:label id="Lbl_date" style="Z-INDEX: 103; LEFT: 296px; POSITION: absolute; TOP: 128px" runat="server" Height="24px" Width="73px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="DarkOrange"></asp:label><asp:label id="lbl_user" style="Z-INDEX: 102; LEFT: 104px; POSITION: absolute; TOP: 128px" runat="server" Height="24px" Width="73px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="DarkOrange"></asp:label><asp:label id="Label3" style="Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 128px" runat="server" Height="24px" Width="40px" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="Teal">Merhaba</asp:label><asp:dropdownlist id="ddl_stat" style="Z-INDEX: 107; LEFT: 112px; POSITION: absolute; TOP: 176px" runat="server" Height="24px" Width="141">
				<asp:ListItem Value="%">All</asp:ListItem>
				<asp:ListItem Value="1">Created</asp:ListItem>
				<asp:ListItem Value="2">Error</asp:ListItem>
			</asp:dropdownlist><asp:textbox id="txt_date" onblur="check_date(this)" style="Z-INDEX: 108; LEFT: 112px; POSITION: absolute; TOP: 208px" runat="server" Height="22px" Width="141px"></asp:textbox><asp:hyperlink id="HyperLink1" style="Z-INDEX: 111; LEFT: 496px; POSITION: absolute; TOP: 128px" runat="server" Height="16px" Width="128px" NavigateUrl="custcreate.aspx" Font-Bold="True" Font-Names="Tahoma" Font-Size="10pt" ForeColor="Indigo">Creation Page</asp:hyperlink><br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<asp:datagrid id="DG_CUST" style="Z-INDEX: 113; LEFT: 40px; POSITION: absolute; TOP: 248px" runat="server" Height="20px" Width="840px" BorderColor="BurlyWood" AutoGenerateColumns="False" HorizontalAlign="Center" AllowPaging="True" PageSize="15">
				<AlternatingItemStyle Font-Size="9pt" HorizontalAlign="Center" ForeColor="DarkBlue" BackColor="#D0CA89"></AlternatingItemStyle>
				<ItemStyle Font-Size="9pt" Font-Names="Verdana" HorizontalAlign="Center" ForeColor="DarkBlue" BackColor="LemonChiffon"></ItemStyle>
				<HeaderStyle Font-Size="10pt" Font-Names="Verdana" Font-Bold="True" HorizontalAlign="Center" ForeColor="Orange" BackColor="DarkCyan"></HeaderStyle>
				<Columns>
					<asp:BoundColumn DataField="ENTRY_ID" HeaderText="ENTRYID">
						<HeaderStyle HorizontalAlign="Center" Width="10px"></HeaderStyle>
						<ItemStyle HorizontalAlign="Center"></ItemStyle>
					</asp:BoundColumn>
					<asp:BoundColumn DataField="CUSTCODE" HeaderText="CUSTCODE">
						<HeaderStyle Width="70px"></HeaderStyle>
						<ItemStyle HorizontalAlign="Center"></ItemStyle>
					</asp:BoundColumn>
					<asp:BoundColumn DataField="COMPANY_NAME" HeaderText="COMPANY NAME">
						<HeaderStyle Width="300px"></HeaderStyle>
					</asp:BoundColumn>
					<asp:BoundColumn DataField="COPY_COUNT" HeaderText="COPY COUNT">
						<HeaderStyle Width="100px"></HeaderStyle>
					</asp:BoundColumn>
					<asp:BoundColumn DataField="ENTRY_DATE" HeaderText="ENTRY DATE">
						<HeaderStyle Width="150px"></HeaderStyle>
					</asp:BoundColumn>
					<asp:BoundColumn DataField="ENTRY_USER" HeaderText="ENTRY USER">
						<HeaderStyle Width="100px"></HeaderStyle>
					</asp:BoundColumn>
				</Columns>
				<PagerStyle Font-Bold="True" BackColor="#FFFFC0" Mode="NumericPages"></PagerStyle>
			</asp:datagrid></form>
	</body>
</HTML>
